package cn.com.zsc.system;

import java.util.Hashtable;
import java.util.Vector;

import javax.servlet.ServletException;

import net.sf.json.JSONArray;

import cn.com.zsc.util.ConstValue;

import com.jarp.db.DAO;

public class Welcome {

	/**
	 * 查询当前用户对应的功能图标
	 * @param userID
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public String getWelcomeInfo(String userID) {
		String querySQL = "select * from cm_commlist where cl_code in (select menuID from app_purview where uid='" + userID + "')";

		DAO dao = new DAO();

		String welcomeStr = ConstValue.EMPTY_RECORD_NOT_PAGEING;
		try {
			Vector<Hashtable<String, String>> v = dao.getDataSet(ConstValue.DBNAME, querySQL);

			JSONArray json = JSONArray.fromObject(v);

			welcomeStr = json.toString();
		} catch (ServletException e) {
			e.printStackTrace();
		}
		
		return welcomeStr;
	}
}
